﻿<phone:PhoneApplicationPage
    x:Class="OnlineVideos.Views.EditStory"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:converter="clr-namespace:OnlineVideos.View_Models"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <converter:TextTrimmer x:Key="TextTrimmer"></converter:TextTrimmer>
        <converter:ImageConverter x:Key="ImageConverter"></converter:ImageConverter>
        <converter:ParaConverter x:Key="ParaConverter"></converter:ParaConverter>
        <converter:ImageVisibility x:Key="ImageVisibility"></converter:ImageVisibility>
        </phone:PhoneApplicationPage.Resources>
            <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"  Background="{StaticResource bipivot}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="10,17,0,28" Orientation="Horizontal">
            <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle" MouseLeftButtonDown="imgTitle_MouseEnter"/>
            <TextBlock x:Name="tblkVideosTitle" Text="Edit Story Paragraphs"  Style="{StaticResource DetailPagePivotTitle}" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,-20,12,0">
            <ListBox x:Name="lbxeditstory" Margin="0,40,0,0" ItemsSource="{Binding}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" Margin="0,30,0,0">
                            <TextBlock x:Name="txtparanum" HorizontalAlignment="Left" Text="{Binding paraId,Converter={StaticResource ParaConverter}}" Width="240" Foreground="White" TextWrapping="Wrap" FontSize="24"></TextBlock>
                            <StackPanel Orientation="Horizontal">
                                <Image x:Name="storyimg"  HorizontalAlignment="Left" Height="100" Width="100" Source="{Binding Image,Converter={StaticResource ImageConverter}}" Visibility="{Binding Image,Converter={StaticResource ImageVisibility}}"></Image>
                                <Image x:Name="edit" Height="48" Width="48" Margin="40,0,0,0"  Source="/Images/PlayerImages/edit.png" Tag="{Binding paraId}" MouseLeftButtonDown="edit_MouseLeftButtonDown_1"></Image>
                                <Image x:Name="delete" Height="48" Width="48" Margin="30,0,0,0"  Source="/Images/PlayerImages/Delete.png" Tag="{Binding paraId}" MouseLeftButtonDown="delete_MouseLeftButtonDown_1"></Image>
                            </StackPanel>
                            <TextBlock x:Name="storydes" FontSize="32" TextWrapping="Wrap" Width="450" Text="{Binding Description,Converter={StaticResource TextTrimmer}}"></TextBlock>

                        </StackPanel>

                    </DataTemplate>
                </ListBox.ItemTemplate>

            </ListBox>
        </Grid>
        <Grid x:Name="grd2" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock x:Name="nostory" Text="No Story To Edit" FontSize="28"></TextBlock>
        </Grid>
    </Grid>
    <!--<phone:PhoneApplicationPage.ApplicationBar>

        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">

            <shell:ApplicationBarIconButton x:Name="btnsave" IconUri="/Images/PlayerImages/save.png" Text="Save" Click="btnsave_Click_1"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
</phone:PhoneApplicationPage>